home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c,comp.std.c
- Subject: Re: Integral conversion e.t.c. (was: Re: Hungarian notation)
- Date: Wed, 07 Feb 96 12:58:40 GMT
- Organization: none
- Message-ID: <823697920snz@genesis.demon.co.uk>
- References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM> <KANZE.96Feb2133347@slsvewt.lts.sel.alcatel.de> <DM5urJ.Aq5@mv.mv.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <DM5urJ.Aq5@mv.mv.com> ENGR@GSSI.MV.COM "Michael Furman" writes:
-
- >In article <KANZE.96Feb2133347@slsvewt.lts.sel.alcatel.de>,
- >kanze@lts.sel.alcatel.de says...
- >> ..................................
- >>Note that implementations *are* allowed to offer extensions, and
- >>define undefined behavior in an implementation specific manner. An
- >>implementation which defines, for example, that writing to the address
- >>0 clears the screen, is perfectly legal. If you write code uniquely
- >>for that implementation, and you have to clear the screen, you will
- >>dereference a null pointer. If this is the only way of clearing the
- >>screen on said implementation, and your application requires clearing
- >>the screen, you will write code dereferencing a null pointer.
- >>
- >>That doesn't make such code any less undefined with regards to the
- >>standard.
- >
- >I can not say that I agree ... Of cause some implementation may define
- >any "undefined" behavior. But I still see two very different cases -
- >a) when construction assumed as incorrect, like dereferinsing wrong
- >pointer and when it has clear purpose, but exect meaning can not be
- >defined portable (like "asm").
-
- Some compilers support a fortran keyword but, like asm, it is not defined
- by the standard. It is up to you to define the environment you want to
- work in. If you want to work in a pure ANSI C environment then asm, fortran
- and numerous other common extensions have no meaning at all and simply
- result in undefined behaviour. If you want to use them define an environment
- in which they have meaning. Most people don't write strict ANSI C code.
- However it is useful to separate what is and isn't strict ANSI C code and use
- ANSI C whenever possible since that makes porting *much* easier.
-
- >What do you think about code with "asm" statements. Is it "less undefined"
-
- As far as ANSI C is concerned it is equally as undefined as any other form
- of undefined behaviour. However there's more to the world than ANSI C.
-
- asm is nothing special in ANSI C hence can be used as an ordinary identifier.
- So a compiler that treats asm specially is unlikely to be conforming i.e.
- behaves differently to what the standard mandates. This can be fixed but
- making asm only 'special' on the inclusion of a non-standard header file.
-
- >and if not - what is the sense and reason of including
- >"asm" keyword in the standard?
-
- None because it isn't! :-)
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-